;; -*- coding: utf-8 -*-
;; 这个命令可以在 windows 下用 "X" 调用系统的文件关联程序打开文件。
(when (and (string-match "GNU" (emacs-version))
	   (string= system-type "windows-nt"))
  (defun dired-custom-execute-file (&optional arg)
	(interactive "P")
	(mapcar #'(lambda (file)
				(w32-shell-execute "open" (convert-standard-filename file)))
			(dired-get-marked-files nil arg)))
  (defun dired-custom-dired-mode-hook ()
	(define-key dired-mode-map "X" 'dired-custom-execute-file))
  (add-hook 'dired-mode-hook 'dired-custom-dired-mode-hook))


(provide 'init-win32)
